



paging= function(formDate) {

    $.ajax({
        url:"/gjquery",
        dataType:"JSON",
        type:"POST",
        data:formDate,
        processData: false,
        contentType: false,
        error:function () {
            alert("error")
        },
        success:function (data) {
           // $("#pageCount").prop("value",data.pageCount)
            console.log("EmpID  "+formDate.get("EmpID"))
            data= data.data
           // console.log(data)

            $("tbody").fadeOut(1000).empty()

            var html=""

            for(key in data){

                var  value=data[key]

                html+="<tr>\n" +
                    "\t<td class='center'>"+value.datee.replace("T16:00:00.000+0000"," 00:00:00.0")+"</td>\n" +
                    "\t<td class='center'>"+value.userno+"</td>\n" +
                    "\t<td>"+value.username+"</td>\n" +
                    "\t<td class='right'>"+value.prevalue1+"</td>\n" +
                    "\t<td class='right'>"+value.prevalue2+"</td>\n" +
                    "\t<td class='center'>"+value.empnmae+"</td>\n" +
                    "\t<td >"+value.remark+"</td>\n" +
                    "\t</tr>\n"
            }

            $("tbody").append(html).fadeIn(1000)



        }

    })//ajax end
}



pagingButtom= function () {



    //记录数
    var pageCount=$("#pageCount").prop("value")

//分页数
    if(pageCount!=0){
        var totalPages=Math.ceil(pageCount/5)

    }

//
    var formDate=new FormData($("form")[0])

    var EmpID=$("#option").prop("value")

    var date1=$("#date1").prop("value")
    var data2=$("#date2").prop("value")
    if(EmpID===undefined||EmpID==0){

        formDate.delete("EmpID")
    }
    if(date1===undefined||date2===undefined){

        formDate.delete("date1")


        formDate.delete("date2")

    }


   // $("#page").empty()

    $.jqPaginator('#page', {
        totalPages: eval(totalPages),
        visiblePages: 1,
        currentPage:eval($("#pageNum").prop("value")) ,
        first:'<a href="javascript:void(0);">第一页</a>',
        prev: '<span><a href="javascript:void(0);">上一页</a>' +
        "<input id='pageIndex' class='pageIndex' value='{{page}}' size='1'/>/ <span class='pageCount'  >"+totalPages+"</span>",
        next: '<a href="javascript:void(0);">下一页</a>',
        last: '<a href="javascript:void(0);">尾页</a>',
        onPageChange: function (num, type) {


            if(type=="change"){

                formDate.set("pageNum",num)


                $("#pageNum").prop("value",num)


                paging(formDate)


            }//if end

        }//onPageChange end
    })

}




pagingButtom()





